package org.example.blog.service.Impl;

import org.example.blog.entity.Myself;
import org.example.blog.mapper.MyselfMapper;
import org.example.blog.service.MyselfService;
import org.example.blog.vo.MyselfInfoVO;
import org.springframework.stereotype.Service;

@Service
public class MyselfServiceImpl implements MyselfService {
    private final MyselfMapper myselfMapper;

    public MyselfServiceImpl(MyselfMapper myselfMapper) {
        this.myselfMapper = myselfMapper;
    }

    @Override
    public MyselfInfoVO findMyselfInfo() {
        Myself myself = myselfMapper.findMyselfInfo();
        return MyselfInfoVO.builder()
                .name(myself.getName())
                .phone(myself.getPhone())
                .qq(myself.getQq())
                .wechat(myself.getWechat())
                .build();
    }
}
